<?

$this->placeholder('page_name')->set($this->artist->name());
?>
<dl>
	<dt>MBID</dt>
	<dd><?= Zupal_Media_MusicBrains::id_string($this->artist->mb_id) ?></dd>
	<dt>True Name</dt>
	<dd><?= $this->artist->person()->name() ?>&nbsp;</dd>

	<dt>performs as</dt>
	<dd><?= $this->artist->name() ?>&nbsp;</dd>

	<dt>Type</dt>
	<dd><?= $this->artist->type ?></dd>

	<dt>Gender</dt>
	<dd><?= $this->artist->person_gender ?>&nbsp;</dd>
</dl>

<fieldset>
	<legend>Relationships</legend>

	<table width="100%">
		<thead>
		<tr>
			<th>ID</th>
			<th>Name</th>
			<th>Type</th>
			<th>Relationship</th>
		</tr>
		</thead>
		<tbody>
		<? foreach($this->artist_mb->get_relations() as $row): ?>
			<tr>
				<td>
					<?=  Zupal_Media_MusicBrains::id_string($row->target) ?>
				</td>
				<td>
<?
	$target = $row->target();
	
	if ($target && $target instanceof Zupal_Media_Musicbrains_Artists):
		echo $this->link(
			$row->label,
			array('module' => 'media',
				'controller' => 'artists',
				'action' => 'view',
				'mb_id' => $row->target
			)
		);
	else:
		echo $row->label;
	endif;
?>
				</td>
				<td>
					<?= $row->target_type ?>
				</td>

				<td>
					<?= $row->type ?>
				</td>

			</tr>
		<? endforeach; ?>
		</tbody>

	</table>


</fieldset>


<fieldset class="ilist">
	<legend><?= $this->artist->name() ?></legend>
<ul>
	<li>
		<?= new Zupal_Control_IconLink('edit.gif', 'Edit', array('module' => 'media',
		'controller' => 'artists',
		'action' => 'edit',
		'node_id' => $this->artist->nodeId(),
		'placement' => Zupal_Control_Icon::PLACEMENT_HORIZONTAL
	)) ?>
	</li>

	<li>
		<?=  new Zupal_Control_IconLink('x.gif', 'Delete', array('module' => 'media',
		'controller' => 'artists',
		'action' => 'delete',
		'id' => $this->artist->identity(),
		'placement' => Zupal_Control_Icon::PLACEMENT_HORIZONTAL
	)) ?>
	</li>
</ul>
</fieldset>
<pre><? print_r($this->data) ?></pre>
<?= $this->headStyle()->captureStart(); ?>
<?= Zupal_Media_MusicBrains::color_css() ?>
<?= $this->headStyle()->captureEnd(); ?>